home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
qbnws204.zip
/
WINDOWS.ZIP
/
WINDOWER.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-07-15
|
33KB
|
569 lines
; WINDOWER.ASM This is a window management system, intended to be linked
; with programs written in Microsoft high-level languages.
; It can be used to draw and restore windows in a variety of
; styles and colours. Windows can be zoomed onto the screen
; and may have shadows to the left or right if required.
;
; Author: Christy Gemmell
; For: Assembly-Language ToolBox for QuickBASIC
; Version: 5.00
; Date: 17/6/1991
;
; Compatible with QuickBASIC 4.x, Extended QuickBASIC and BASIC 7
; Assembled with MicroSoft Macro Assembler, MASM version 5.1
;
; Exploding and imploding windows implemented 17/6/91
;
;┌────────────────────────────────────────────────────────────────────────┐
;│ Global symbols and procedures. │
;└────────────────────────────────────────────────────────────────────────┘
;
.model medium
extrn Delay:proc
extrn Explode:proc
extrn ScreenAddress:proc
extrn ScreenCopy:proc
extrn ScreenWrite:proc
extrn VideoType:proc
extrn WriteByte:proc
public PopUp, ShutUp
.code
;┌────────────────────────────────────────────────────────────────────────┐
;│ Data Division. │
;└────────────────────────────────────────────────────────────────────────┘
;
Signature db ' WINDOW MANAGER By Christy Gemmell '
Ulc label word ; Upper left co-ordinate
TlRow db ? ; Top left screen row
TlCol db ? ; Top left screen column
Lrc label word ; Lower right co-ordinate
BrCol db ? ; Right column of window
BrRow db ? ; Bottom row of window
Area label word
Breadth db ? ; Window width (inc shadow)
Height db ? ; Window Height (inc shadow)
ToDo label word
Cols2do db ? ; Columns to restore
Rows2do db ? ; Rows to restore
Rows db ? ; Screen length in rows
Columns db ? ; Screen width in columns
Increment dw ? ; Interval between rows
BuffPtr dw ? ; Pointer to current buffer
BuffTop dw ? ; Offset of first buffer row
BuffEnd dw ? ; Offset of last buffer row
WinTop dw ? ; Offset of first screen row
WinEnd dw ? ; Offset of last screen row
TopLeft label byte
db ' ┌╔╒╓╤╦┬╥' ; TL Corner characters
TopRight label byte
db ' ┐╗╕╖╤╦┬╥' ; TR Corner characters
BotLeft label byte
db ' └╚╘╙╘╚└╙' ; BL Corner characters
BotRight label byte
db ' ┘╝╛╜╛╝┘╜' ; BR Corner characters
Vertical label byte
db ' │║│║│║│║' ; Vertical characters
Horizontal label byte
db ' ─══─══──' ; Horizontal characters
Buffer label byte ; Start of screen buffer
db 4000h dup(0)
BufferTop dw 0 ; End of screen Buffer
;┌────────────────────────────────────────────────────────────────────────┐
;│ POPUP | Save a screen rectangle and replace it with a window. │
;└────────────────────────────────────────────────────────────────────────┘
;
PopUp proc far
push bp ; Save Base pointer
mov bp,sp ; Establish stack frame
push ds ; Preserve segment
push es ; registers and
push di ; index
push si ; pointers
call VideoType ; Get video parameters
push cs ; Align Code and
pop ds ; Data segments
mov Rows,bl ; Store screen height
mov Columns,ah ; Store screen width
mov al,ah ; Transfer number of
xor ah,ah ; columns to AX
shl ax,1 ; and convert
mov Increment,ax ; to bytes
mov al,[bp+20] ; Get top-left row
dec al ; Make it base zero
cmp al,0 ; Check for
jae Pop_01 ; legal
xor al,al ; values
Pop_01:
mov TlRow,al ; Save top-left row
mov al,[bp+18] ; Get top-left column
dec al ; Make it base zero
cmp al,0 ; Check for
ja Pop_02 ; legal
mov al,1 ; values
Pop_02:
mov TlCol,al ; Store top-left column
mov al,[bp+16] ; Get window height
cmp al,2 ; Check for
ja Pop_03 ; legal
mov al,3 ; values
Pop_03:
mov [bp+16],al ; Store window height
mov al,[bp+14] ; Get window width
cmp al,2 ; Check for
ja Pop_04 ; legal
mov al,3 ; values
Pop_04:
mov [bp+14],al ; Store window width
mov al,TlRow ; Get start row
mov ah,[bp+16] ; Get number of rows
add al,ah ; Add 'em together
cmp al,Rows ; Out of bounds?
jb Pop_05 ; No, carry on
jmp Pop_38 ; Else abort
Pop_05:
dec al ; Store bottom
mov BrRow,al ; row number
mov al,TlCol ; Get start column
mov ah,[bp+14] ; Get number of columns
add al,ah ; Add 'em together
cmp al,Columns ; Out of bounds?
jb Pop_06 ; No, carry on
jmp Pop_38 ; Else abort
Pop_06:
dec al ; Store rightmost
mov BrCol,al ; column number
mov al,[bp+10] ; Get required border type
cmp al,0 ; Check
jb Pop_07 ; for
cmp al,8 ; legal
ja Pop_07 ; values
jmp short Pop_08
Pop_07:
mov byte ptr [bp+10],1 ; Set default (single line)
Pop_08:
mov ax,[bp+8] ; See if shadow i